package com.dc.refactoring._1_重新组织函数._3_InlineTemp;

import lombok.extern.slf4j.Slf4j;

/**
 * Description: 内联临时变量
 * @author: gdc
 * @date: 2020/11/13
 * @version 1.0
 */
@Slf4j
public class Test {
    int number = 1001;

    public int getNumber() {
        return number;
    }

    public boolean moreThan1000() {
        // 当前临时变量，只被一个简单表达式赋值一次
        final int thisNumber = getNumber();
        return thisNumber > 1000;
    }

    public boolean moreThan2000() {
        return getNumber() > 2000;
    }

}
